<?php

use App\Controller\admin\AccountController;
use App\Controller\admin\DeptController;
use App\Controller\admin\DictController;
use Hyperf\HttpServer\Router\Router;

Router::addGroup('/account',function (){
    Router::addRoute(['GET', 'POST'],'/login',[AccountController::class,'login']);
    Router::addRoute(['GET', 'POST'],'/index',[AccountController::class,'index']);
    Router::addRoute(['GET', 'POST'],'/captcha',[AccountController::class,'captcha']);
    Router::addRoute(['GET', 'POST'],'/logout',[AccountController::class,'logout']);
    Router::addRoute(['GET', 'POST'],'/info',[AccountController::class,'info']);
    Router::addRoute(['GET', 'POST'],'/update',[AccountController::class,'update']);
    Router::addRoute(['GET', 'POST'],'/password',[AccountController::class,'password']);
});
Router::addGroup('/dict',function (){
    Router::get('/get/{name}', [DictController::class, 'get']);
    Router::get('/index', [DictController::class, 'index']);
    Router::addRoute(['GET', 'POST'],'/select', [DictController::class, 'select']);
    Router::addRoute(['GET', 'POST'],'/insert', [DictController::class, 'insert']);
    Router::addRoute(['GET', 'POST'],'/update', [DictController::class, 'update']);
    Router::addRoute(['GET', 'POST'],'/delete', [DictController::class, 'delete']);
});

Router::addGroup('/dept',function (){
    Router::addRoute(['GET', 'POST'],'/index', [DeptController::class, 'index']);
    Router::addRoute(['GET', 'POST'],'/select', [DeptController::class, 'select']);
    Router::addRoute(['GET', 'POST'],'/insert', [DeptController::class, 'insert']);
    Router::addRoute(['GET', 'POST'],'/update', [DeptController::class, 'update']);
    Router::addRoute(['GET', 'POST'],'/select_tree', [DeptController::class, 'select_tree']);
});

